{% extends 'layout.html' %}


{% block main %}
<ol class="breadcrumb">
    <li><a href="#">内容首页</a></li>
    <li>编辑内容</li>
</ol>



<form action="/admin/content/add" method="post">
    <div class="form-group">
        分类{{content.category._id.toString()}}
        <select name="category" id="category" class="form-control">
            {% for category in categories%}
            {% if content.category._id.toString() === category.id %}
            <option value="{{category.id}}" selected>{{category.name}}</option>
            {% else %}
            <option value="{{category.id}}">{{category.name}}</option>
            {% endif%}
            {% endfor %}
        </select>
    </div>
    <div class="form-group">
        标题
        <input type="text" value='{{content.title}}'class="form-control" name="title" placeholder="请输入标题">
    </div>
    <div class="form-group">
        简介
        <textarea class="form-control" name="description" rows="5">{{content.description}}</textarea>
    </div>
    <div class="form-group">
        内容
        <textarea class="form-control" name="content" rows="10">{{content.content}}</textarea>
    </div>
    <input type="submit" value="提交">
</form>


{% endblock %}